package com.ruoyi.project.zerocarbon.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.zerocarbon.domain.DeclareRanking;
import com.ruoyi.project.zerocarbon.mapper.DeclareRankingMapper;
import com.ruoyi.project.zerocarbon.service.IDeclareRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专家评分Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-31
 */
@Service
public class DeclareRankingServiceImpl implements IDeclareRankingService
{
    @Autowired
    private DeclareRankingMapper declareRankingMapper;

    /**
     * 查询专家评分
     * 
     * @param id 专家评分ID
     * @return 专家评分
     */
    @Override
    public DeclareRanking selectDeclareRankingById(Long id)
    {
        return declareRankingMapper.selectDeclareRankingById(id);
    }

    /**
     * 查询专家评分列表
     * 
     * @param declareRanking 专家评分
     * @return 专家评分
     */
    @Override
    public List<DeclareRanking> selectDeclareRankingList(DeclareRanking declareRanking)
    {
        return declareRankingMapper.selectDeclareRankingList(declareRanking);
    }

    /**
     * 新增专家评分
     * 
     * @param declareRanking 专家评分
     * @return 结果
     */
    @Override
    public int insertDeclareRanking(DeclareRanking declareRanking)
    {
        declareRanking.setCreateTime(DateUtils.getNowDate());
        return declareRankingMapper.insertDeclareRanking(declareRanking);
    }

    /**
     * 修改专家评分
     * 
     * @param declareRanking 专家评分
     * @return 结果
     */
    @Override
    public int updateDeclareRanking(DeclareRanking declareRanking)
    {
        declareRanking.setUpdateTime(DateUtils.getNowDate());
        return declareRankingMapper.updateDeclareRanking(declareRanking);
    }

    /**
     * 批量删除专家评分
     * 
     * @param ids 需要删除的专家评分ID
     * @return 结果
     */
    @Override
    public int deleteDeclareRankingByIds(Long[] ids)
    {
        return declareRankingMapper.deleteDeclareRankingByIds(ids);
    }

    /**
     * 删除专家评分信息
     * 
     * @param id 专家评分ID
     * @return 结果
     */
    @Override
    public int deleteDeclareRankingById(Long id)
    {
        return declareRankingMapper.deleteDeclareRankingById(id);
    }
}
